home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
NEWNAME.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
738b
|
25 lines
' NEWNAME.BAS
' This program lets you rename a data file in the current directory.
CLS
PRINT "The current directory contains the following files:"
PRINT
FILES "*.*" ' display files in current directory
PRINT ' get old and new filenames
INPUT "Which file would you like to rename? ", oldName$
INPUT "What would you like the new name to be? ", newName$
NAME oldName$ AS newName$ ' try to rename file
' if oldName$ does not exist or newName$ is an invalid name, the
' NAME statement will generate a run-time error; otherwise, the
' following lines will be executed:
PRINT ' print success message
PRINT UCASE$(oldName$); " renamed successfully"